home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8560 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: dereferencing pointer to incomplete type
  5. Date: 4 Mar 96 14:53:03 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.825951183@rscernix>
  8. References: <1996Mar3.040741.27234@dcs.warwick.ac.uk>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <1996Mar3.040741.27234@dcs.warwick.ac.uk> D.C.Molero@dcs.warwick.ac.uk (Daniel Castillo Molero) writes:
  13.  
  14. >I wonder if anybody can help me to debug the short code below.
  15. >It is supposed to calculate the area of a polygon, but when I compile
  16. >it with  gcc program.c, it gives me the following errors,
  17. >
  18. >program.c: In function `calc_area':
  19. >program.c:22: warning: assignment from incompatible pointer type
  20. >program.c:24: dereferencing pointer to incomplete type
  21. >program.c:24: dereferencing pointer to incomplete type
  22. >program.c:26: warning: assignment from incompatible pointer type
  23. >
  24. >
  25. >which I don't understand at all.
  26. >
  27. >I would appreciate very much any sort of help.
  28. >
  29. >------------------
  30. >
  31. >struct polygon
  32. >{
  33. >  int tried;
  34. >  double x, y;
  35. >  int dir, numtimes, conv;
  36. >  struct polyg *next;
  37.    ^^^^^^^^^^^^
  38. >};
  39.  
  40. I can't see any definition for struct polyg in the posted code.
  41. It's obvious that you meant "struct polygon", but it's not obvious at
  42. all why you can't find your typos yourself.
  43.  
  44. Dan
  45. --
  46. Dan Pop
  47. CERN, CN Division
  48. Email: danpop@mail.cern.ch 
  49. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  50.